package situ.autoweter.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import situ.autoweter.service.PySumreportService;
import situ.autoweter.entity.PySumreport;
import java.util.*;
/**
 * PySumreport的路由接口服务
 * 
 * @author 胡文
 *
 */
@Controller
public class PySumreportController {

	/** PySumreportService服务 */
	@Autowired
	private PySumreportService pySumreportService;
	
	/**
	 * 查询所有PySumreport数据的方法
	 * @param value
	 * @return
	 */
	@RequestMapping(value = "queryPySumreport", produces = {"application/json;charset=UTF-8"})
	public String find(PySumreport value,Map map) {
		 List<PySumreport> list= pySumreportService.find(value);
         map.put("items",list);
         return "页面名称自己改";
	}
	
	/**
	 * 通过id查询PySumreport数据的方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "queryPySumreportById/{id}", produces = {"application/json;charset=UTF-8"})
	public String findOne(@PathVariable(name="id") Object id,Map map) {
        PySumreport obj=  pySumreportService.findOne(id);
        map.put("PySumreport",obj);
        return "页面名称自己改";
	}
	
	/**
	 * 插入PySumreport属性不为空的数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "savePySumreport", produces = {"application/json;charset=UTF-8"})
	public String save(PySumreport value) {
		  pySumreportService.saveNotNull(value);
        return "redirect:/queryPySumreport";
	}
	
	/**
	 * 更新PySumreport属性不为空的数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "updatePySumreport", produces = {"application/json;charset=UTF-8"})
	public String update(PySumreport value) {
		  pySumreportService.updateNotNullById(value);
          return "redirect:/queryPySumreport";
	}
	
	/**
	 * 通过id删除PySumreport数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "delPySumreportById/{id}", produces = {"application/json;charset=UTF-8"})
	public String delete(@PathVariable(name="id") Object id) {
		  pySumreportService.deleteById(id);
          return "redirect:/queryPySumreport";
	}
}
